package com.controller;

import com.Result.UserResult;
import com.pojo.User;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {


    @Autowired
    private UserService userService;

    @RequestMapping("/findAll")
    public List<User> findAll(){
        List<User> user = userService.findAll();
        return user;
    }

    @RequestMapping("/findPage")
    public UserResult<User> findPage(Integer page, Integer size){
        UserResult<User> userList = userService.findPage(page, size);
        return userList;
    }

}
